package com.qianchang.microfinance.view.mine.loan;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import com.qianchang.microfinance.R;
import com.qianchang.microfinance.view.base.BaseActivity;
import com.qianchang.microfinance.view.hsdialog.QuickenConfirmPayDialog;
import com.qianchang.microfinance.view.hsdialog.QuickenWithdrawDialog;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


/**
 * 加速提现状态页面
 */


public class HSQuickenWithdrawActivity extends BaseActivity implements QuickenWithdrawDialog.OnDialogClickListener,QuickenConfirmPayDialog.OnDialogClickListener{


    @BindView(R.id.lv_schedule_id)
    ListView scheduleListView;
    @BindView(R.id.withdraw_money_id)
    TextView withdrawMoney;
    @BindView(R.id.tv_bank_name_id)
    TextView bankName;
    @BindView(R.id.tv_bank_nub_id)
    TextView bankText;
    @BindView(R.id.btn_quicken)
    Button quickenBut;

    private HSWithdrawAdapter adapter;




    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_hsquickenwithdraw_layout);
        ButterKnife.bind(this);
        initView();
        initData();
    }

    @Override
    protected void initView() {
        super.initView();
        setTitleName(getString(R.string.withdraw_hs));


    }

    @Override
    protected void initData() {
        super.initData();
        adapter = new HSWithdrawAdapter(HSQuickenWithdrawActivity.this);
        scheduleListView.setAdapter(adapter);
        adapter.setIndex(0);

    }

    @OnClick({R.id.btn_quicken})
    public void onViewClicked(View view){
        switch (view.getId()){
            case R.id.btn_quicken:
                QuickenWithdrawDialog quickenWithdrawDialog = QuickenWithdrawDialog.newInstance();
                quickenWithdrawDialog.setOnDialogClickListener(HSQuickenWithdrawActivity.this);
                quickenWithdrawDialog.show(getSupportFragmentManager(), "openedDialog");            //测试使用

                break;
            default:
                break;
        }
    }



    @Override
    public void quickPay() {

        QuickenConfirmPayDialog quickenConfirmPayDialog = QuickenConfirmPayDialog.newInstance();
        quickenConfirmPayDialog.setOnDialogClickListener(HSQuickenWithdrawActivity.this);
        quickenConfirmPayDialog.show(getSupportFragmentManager(), "comfirmpay");

    }

    @Override
    public void quickencloseDialog() {


    }

    //确认支付弹出窗里面的确认按钮回调
    @Override
    public void truePay() {
        adapter.setIndex(3);
    }

    //确认支付弹出窗关闭按钮
    @Override
    public void closeDialog() {

    }

}
